

<table style="display: inline;"><tr><td>
<a href="javascript:get_list_user_room('', 1);" class="page">Trang đầu</a>
</td>
<?php
/**
 * @author HIENDV
 * @copyright 2012
 */
session_start();
$room_id=$_REQUEST['room_id'];
$uname=$_REQUEST['uname'];
$date=$_REQUEST['date'];
$page=$_REQUEST['page'];
$per_page=$_REQUEST['per_page'];
include_once '../../Model/Room.php';
$room= new Room();
$rs=$room->listpage_user_room($room_id, $uname, $date, $page, $per_page, 2);
$result='';
for($i=0;$i<count($rs);$i++){
    if($rs[$i]==-1) {
        $j='<img src="lib/images/icon_previous.gif">';
        $result=$result.'<td><span class=paging><a href="javascript:get_list_user_room(\'\',\''.($rs[1]-1).'\');">'.$j.'</a></span></td>';
    }
    else if($rs[$i]==-2) {
        $j='<img src="lib/images/icon_next.gif">';
       // echo $rs[count($rs)-1];
        $result=$result.'<td ><span class=paging><a href="javascript:get_list_user_room(\'\',\''.($rs[count($rs)-2]+1).'\')">'.$j.'</a></span></td>';
    }
    else {
        $j=$rs[$i];
        if($j==$page) $class='<td ><span class=paging ><a style="background-color:#999" href="javascript:get_list_user_room(\'\',\''.$rs[$i].'\')">'.$j.'</a></span></td>';
        else $class='<td id=page{f01page}><span class=paging><a href="javascript:get_list_user_room(\'\',\''.$rs[$i].'\')">'.$j.'</a></span></td>';
        $result=$result.$class;
    }
    
}
echo $result;
?>
<td><a style="display:inline;" href="javascript:GoEndPage2()"><span>Trang cuối</span></a></td></tr></table>
